Skip to content

Mint a candidate /edit receipt after a passing bounded check - #116

Merged
usrname1git merged 1 commit into
mainfrom
fix/local-edit-receipt
Sep 10, 2026
Merged

Mint a candidate /edit receipt after a passing bounded check#116
usrname1git merged 1 commit into
mainfrom
fix/local-edit-receipt

Conversation

@usrname1git

Copy link
Copy Markdown
Owner

Summary

Split from wip/desk-cs2-local-edit (CS2 and Skill Lab catalog left on that branch).

After /edit applies and the bounded check passes (not rolled back), mint a candidate Golden Record via memory::save_thought (sector=local-edit, source_type=edit_receipt, skill_promote_eligible=false). /last-edit shows receipt= or receipt=none. Rollback / missing verifier does not mint.

Test plan

  • local_edit_test.exelocal_edit_test ok
  • Live /edit that passes a bounded check writes a candidate (not auto-verified)
  • Failed/rolled edit does not mint

Not in this PR: CS2 scripts, Skill Lab catalog, SRE fixture.

A successful apply that is not rolled back now calls an optional receipt sink. The kernel writes a candidate Golden Record (sector local-edit, source_type edit_receipt, skill_promote_eligible=false). Failures and missing verifiers do not mint. local_edit_test covers pass, rollback, and missing-check paths.
Copilot AI lite review requested due to automatic review settings September 10, 2026 08:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The receipt is minted only after a successful apply plus passing bounded verification, the new fields are persisted and surfaced consistently, and the new behavior is covered by updated local_edit tests.

Pull request overview

This PR adds a “local edit receipt” mechanism in the C++ kernel so that after a successful /edit apply and a passing bounded verifier check, the kernel mints a candidate Golden Record (via memory::save_thought) representing that verified local-edit outcome, and surfaces the receipt status via /last-edit.

Changes:

  • Add receipt minting hooks to local_edit (eligibility check + formatted receipt body + configurable sink) and persist receipt_saved/receipt_id in the last-edit result JSON.
  • Wire the kernel (main.cpp) to save eligible receipts through memory::save_thought(sector=local-edit, source_type=edit_receipt).
  • Extend local_edit_test to validate that passing edits mint exactly one receipt and that rollbacks / missing verifier do not mint.
File summaries
File Description
godbrain_core/cpp_kernel/main.cpp Adds /last-edit receipt display and installs the receipt sink that persists candidate receipts via memory::save_thought.
godbrain_core/cpp_kernel/local_edit.h Extends Result with receipt fields and exposes receipt helpers + sink configuration.
godbrain_core/cpp_kernel/local_edit.cpp Implements receipt eligibility/formatting, stores receipt status in last-edit JSON, and invokes the sink after passing bounded checks.
godbrain_core/cpp_kernel/local_edit_test.cpp Adds unit coverage ensuring receipts are minted only for passing edits and never for rollback/missing-verifier cases.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@usrname1git
usrname1git merged commit 3c1c887 into main Sep 10, 2026
1 check passed
@usrname1git
usrname1git deleted the fix/local-edit-receipt branch September 10, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants